package edu.pku.sei.transformation.mtparser;

import lpg.runtime.*;

/**
 *<b>
 *<li>Rule 35:  EqualExpr ::= BooleanFactorExpr$LeftExpr = BooleanFactorExpr$RightExpr
 *</b>
 */
public class EqualExpr extends Ast implements IEqualExpr
{
    private IBooleanFactorExpr _LeftExpr;
    private IBooleanFactorExpr _RightExpr;

    public IBooleanFactorExpr getLeftExpr() { return _LeftExpr; }
    public IBooleanFactorExpr getRightExpr() { return _RightExpr; }

    public EqualExpr(IToken leftIToken, IToken rightIToken,
                     IBooleanFactorExpr _LeftExpr,
                     IBooleanFactorExpr _RightExpr)
    {
        super(leftIToken, rightIToken);

        this._LeftExpr = _LeftExpr;
        this._RightExpr = _RightExpr;
        initialize();
    }

    public boolean equals(Object o)
    {
        if (o == this) return true;
        if (! (o instanceof EqualExpr)) return false;
        if (! super.equals(o)) return false;
        EqualExpr other = (EqualExpr) o;
        if (! _LeftExpr.equals(other._LeftExpr)) return false;
        if (! _RightExpr.equals(other._RightExpr)) return false;
        return true;
    }

    public int hashCode()
    {
        int hash = super.hashCode();
        hash = hash * 31 + (_LeftExpr.hashCode());
        hash = hash * 31 + (_RightExpr.hashCode());
        return hash;
    }

    public void accept(Visitor v) { v.visit(this); }
    public void accept(ArgumentVisitor v, Object o) { v.visit(this, o); }
    public Object accept(ResultVisitor v) { return v.visit(this); }
    public Object accept(ResultArgumentVisitor v, Object o) { return v.visit(this, o); }
}


